// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Layout from './components/layout'
import VueRouter from 'vue-router'
import IndexPage from './pages/index'
import DetailPage from './pages/detail'
import OrderListPage from './pages/orderList'
import DetailAnaPage from './pages/detail/analysis'
import DetailCouPage from './pages/detail/count'
import DetailForPage from './pages/detail/forecast'
import DetailPubPage from './pages/detail/publish'
import p1 from './pages/detail/wlwx.vue'
import p2 from './pages/detail/shps.vue'
import p4 from './pages/detail/dydp.vue'
// import VueResource from 'vue-resource'
import axios from './http'
// import axios from 'axios'

Vue.config.productionTip = false

/* eslint-disable no-new */
Vue.use(VueRouter)
Vue.use(axios)
// Vue.prototype.$http=axios
// Vue.use(VueResource)
let router = new VueRouter({
  // mode: 'history',
  routes: [{
      path: '/',
      name: 'IndexPage',
      component: IndexPage
    },
    {
      path: '/orderList',
      name: 'OrderListPage',
      component: OrderListPage
    },
    {
      path: '/detail',
      name: 'DetailPage',
      component: DetailPage,
      children: [{
          path: 'analysis',
          name: 'DetailAnaPage',
          component: DetailAnaPage
        },
        {
          path: 'count',
          // component: DetailCouPage
          name: 'p1',
          component: p1
        },
        {
          path: 'forecast',
          // component: DetailForPage
          name: 'p2',
          component: p2
        },
        {
          path: 'publish',
          // component: DetailPubPage
          name: 'p4',
          component: p4
        }
      ]
    }
  ]
})
new Vue({
  el: '#app',
  router,
  template: '<Layout/>',
  components: {
    Layout
  }
})
